package org.dromara.Nyt7StatisticsClaimAreaCompany.controller;

import java.util.List;

import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.Nyt7StatisticsClaimAreaCompany.domain.vo.Nyt7StatisticsClaimAreaCompanyVo;
import org.dromara.Nyt7StatisticsClaimAreaCompany.domain.bo.Nyt7StatisticsClaimAreaCompanyBo;
import org.dromara.Nyt7StatisticsClaimAreaCompany.service.INyt7StatisticsClaimAreaCompanyService;
import org.dromara.common.mybatis.core.page.TableDataInfo;

/**
 * 统计分析_投保统计_数量统计_按地区的数量统计
 *
 * @author yt
 * @date 2025-01-06
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/Nyt7StatisticsClaimAreaCompany/Nyt7StatisticsClaimAreaCompany")
public class Nyt7StatisticsClaimAreaCompanyController extends BaseController {

    private final INyt7StatisticsClaimAreaCompanyService nyt7StatisticsClaimAreaCompanyService;

    /**
     * 查询统计分析_投保统计_数量统计_按地区的数量统计列表
     */
    @SaCheckPermission("Nyt7StatisticsClaimAreaCompany:Nyt7StatisticsClaimAreaCompany:list")
    @GetMapping("/list")
    public TableDataInfo<Nyt7StatisticsClaimAreaCompanyVo> list(Nyt7StatisticsClaimAreaCompanyBo bo, PageQuery pageQuery) {
        return nyt7StatisticsClaimAreaCompanyService.queryPageList(bo, pageQuery);
    }

    /**
     * 导出统计分析_投保统计_数量统计_按地区的数量统计列表
     */
    @SaCheckPermission("Nyt7StatisticsClaimAreaCompany:Nyt7StatisticsClaimAreaCompany:export")
    @Log(title = "统计分析_理赔统计_已决赔款面积统计_按保险公司统计", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(Nyt7StatisticsClaimAreaCompanyBo bo, HttpServletResponse response) {
        List<Nyt7StatisticsClaimAreaCompanyVo> list = nyt7StatisticsClaimAreaCompanyService.queryList(bo);
        ExcelUtil.exportExcel(list, "统计分析_理赔统计_已决赔款面积统计_按保险公司统计", Nyt7StatisticsClaimAreaCompanyVo.class, response);
    }

}
